import BaseModel from './.model';
import { Table, Column, DataType, ForeignKey } from 'sequelize-typescript';
import ProductModel from './product.model';
import CategoryModel from './category.model';

@Table({ tableName: 'product_categories' })
export default class ProductCategoryModel extends BaseModel {
  /** 产品ID */
  @ForeignKey(() => ProductModel)
  @Column({ type: DataType.UUID, comment: '产品ID' })
  productId!: string;

  /** 类别ID */
  @ForeignKey(() => CategoryModel)
  @Column({ type: DataType.UUID, comment: '类别ID' })
  categoryId!: string;
}